#pragma once

#include <string>
#include "rtda/frame.h"
#include "native/registry.h"

namespace jvm {
    namespace lang {

        class SystemNative {
        private:
            static const std::string JL_SYSTEM;

            static bool checkArrayCopy(heap::ObjectPtr src, heap::ObjectPtr dest);

        public:
            static void init() {
                native::Registry::registerMethod(JL_SYSTEM, "arraycopy", "(Ljava/lang/Object;ILjava/lang/Object;II)V", &arraycopy);

                //native::Registry::registerMethod(JL_SYSTEM, "initProperties", "(Ljava/util/Properties;)Ljava/util/Properties;", initProperties);
                //native::Registry::registerMethod(JL_SYSTEM, "setIn0", "(Ljava/io/InputStream;)V", setIn0);
                //native::Registry::registerMethod(JL_SYSTEM, "setOut0", "(Ljava/io/PrintStream;)V", setOut0);
                //native::Registry::registerMethod(JL_SYSTEM, "setErr0", "(Ljava/io/PrintStream;)V", setErr0);
                //native::Registry::registerMethod(JL_SYSTEM, "currentTimeMillis", "()J", currentTimeMillis);
            }

            static void arraycopy(std::shared_ptr<rtda::Frame> frame);

            //static void initProperties(std::shared_ptr<rtda::Frame> frame);
            //static void setIn0(std::shared_ptr<rtda::Frame> frame);
            //static void setOut0(std::shared_ptr<rtda::Frame> frame);
            //static void setErr0(std::shared_ptr<rtda::Frame> frame);
            //static void currentTimeMillis(std::shared_ptr<rtda::Frame> frame);
        };

    } // namespace lang
} // namespace jvm